Skip to content

Conversation

57300
Copy link
Contributor

@57300 57300 commented Aug 21, 2025

No description provided.

57300 and others added 5 commits August 21, 2025 09:56
This reverts commit 15cd2f6.

To be re-applied after cherry-picks.

Signed-off-by: Grzegorz Swiderski <[email protected]>
Upstream PR #: 94330

Allow the ZMS API to optionally accept 64 bit IDs. A typedef `zms_id_t`
is added, so that the maximum ID width can be controlled using Kconfig.

The current ATE structure is already large enough that it is possible to
reserve 64 bits for IDs without increasing its total size (128 bits).
This makes the feature a natural, low footprint alternative to Settings,
for cases where the supported key namespace must be larger than 32 bit
but not arbitrarily large.

The ATE format does have to be altered to accommodate larger IDs, but
the default "32 bit" format is left as is. Now, the `struct zms_ate`
describes one of two supported formats, selected based on an `#ifdef`.
In the future, it may be possible to support multiple ATE formats at
runtime, in which case the structure can be turned into a union.

In the new, "64 bit" ATEs, the `offset` and `metadata` fields are moved
into a union, because they are found to be mutually exclusive. With the
old format, the same fields are in different locations, but one of them
always gets filled with a dummy value, depending on the given ATE type.
To cover both cases, use a `memset` which the compiler can optimize away
when appropriate.

The only limitation is that the new ATE format has no room for data CRC,
but an alternative integrity check can be implemented by the caller.

Signed-off-by: Grzegorz Swiderski <[email protected]>
(cherry picked from commit 11e2cd69f89595f6eaafc74a75a78121532b8885)
Upstream PR #: 94330

* Explicitly skip tests that depend on CONFIG_ZMS_LOOKUP_CACHE.

* In `testcase.yaml`, use `extra_configs` instead of `extra_args` for
  setting Kconfigs.

Signed-off-by: Grzegorz Swiderski <[email protected]>
(cherry picked from commit bde68d15bb6e017f75dcec2b99d9cac642361661)
Upstream PR #: 94330

* Update the "corrupt ATE" tests to work with the new ATE format.

* Add a basic test to verify support to 64 bit ZMS IDs.

* Add a `testcase.yaml` entry to cover the above points and also run
  lookup cache tests to evaluate the 64 bit hash function.

Signed-off-by: Grzegorz Swiderski <[email protected]>
(cherry picked from commit 6313c77daec51a20f7d4e0f4ad213f4bac54010d)
ZMS legacy enabled by CONFIG_SETTINGS_ZMS_LEGACY uses a different lookup
cache function that is optimized for Settings subsystem.

Signed-off-by: Riadh Ghaddab <[email protected]>
(cherry picked from commit 491354b)
(cherry picked from commit 15cd2f6)
@rlubos rlubos merged commit 8ccb986 into nrfconnect:main Aug 21, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants